﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UsersEdit.aspx.cs" Inherits="PPAP.Web.Master.UsersEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head >
    <title></title>
    <script type="text/javascript">
        function check() {
            var testitem = document.getElementById("txtFamilyname").value;
            var remark = document.getElementById("txtFirstname").value;
            var username = document.getElementById("txtUserName").value;
            var email = document.getElementById("txtEmail").value;
            if (testitem == "") {
                alert("Family name is null");
                return false;
            }
            if (remark == "") {
                alert("First name is null");
                return false;
            }
            if (username == "") {
                alert("UserName is null");
                return false;
            }
            if (email == "") {
                alert("Email is null");
                return false;
            }
            var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
           if(!myreg.test(email))
            {
                alert('Email format error！');
               return false;
           }
            return confirm('Are you sure you want to save?');
        }
    </script>
    <style type="text/css">
        .style1
        {
            height: 23px;
        }
    </style>
</head>
<body style="font-family: Arial, Helvetica, sans-serif;overflow-x:hidden; "  bgcolor="#E7E8E8">
    <form id="form1" runat="server">
    <div>
    <table align="center" width="100%" style="margin-top:10px;">
    <tr><td style="width:25%">
        Family name
        </td><td style="width:25%">
            <asp:TextBox ID="txtFamilyname" runat="server"></asp:TextBox><font color='red'>*</font>
        </td><td style="width:25%">
            First name
        </td><td style="width:25%">
            <asp:TextBox ID="txtFirstname" runat="server"></asp:TextBox><font color='red'>*</font>
        </td></tr>
          <tr><td>
        Email</td><td>
                  <asp:TextBox ID="txtEmail" runat="server" AutoPostBack="True" 
                      ontextchanged="txtEmail_TextChanged"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                ControlToValidate="txtEmail" ErrorMessage="×" 
                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
        </td><td>
              UserName</td><td>
                  <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox><font color='red'>*</font></td></tr>
          <tr><td>
            Mobile phone
        </td><td style="width:25%">
            <asp:TextBox ID="txtMobilephone" runat="server"></asp:TextBox>
        </td><td>
        Department
        </td><td>
            <asp:DropDownList ID="ddlDepartment" runat="server" Width="155px">
            </asp:DropDownList>
        </td></tr>
        <tr><td class="style1">
            Position
        </td><td class="style1">
                <asp:DropDownList ID="ddlPosition" runat="server" Width="155px">
            </asp:DropDownList>
                </td><td class="style1">
                Superior</td><td class="style1">
                <asp:DropDownList ID="ddlUser" runat="server">
                </asp:DropDownList>
        </td></tr>
          <tr><td>Country </td><td>
                <asp:DropDownList ID="ddlCountry" runat="server" Width="155px">
                    <asp:ListItem>China</asp:ListItem>
                    <asp:ListItem>Germany</asp:ListItem>
                    <asp:ListItem>other</asp:ListItem>
                </asp:DropDownList>
                </td><td>Sort</td><td>
                <asp:TextBox ID="txtSort" runat="server"></asp:TextBox>
                </td></tr>
        <tr runat="server" id="tr" ><td>Execute inspection task？</td><td>
            <asp:RadioButton 
                    ID="rbtY" runat="server" GroupName="s" 
                    Text="Yes" AutoPostBack="True" oncheckedchanged="rbtY_CheckedChanged" />
&nbsp; <asp:RadioButton ID="rbtN" runat="server" GroupName="s" Text="No" AutoPostBack="True" 
                    Checked="True" oncheckedchanged="rbtY_CheckedChanged" />
            </td><td>
                <asp:Label ID="Label1" runat="server" Text="Test Department" Visible="False"></asp:Label>
            </td><td>
            <asp:DropDownList ID="DropDownList1" runat="server" Visible="False">
            </asp:DropDownList>
            </td></tr>
            <tr runat="server" id="trde"><td colspan="4">
            <br />
               Please select test department:
                    <asp:CheckBoxList ID="cbDe" runat="server" RepeatColumns="5" 
                    RepeatDirection="Horizontal" Width="100%">
                    </asp:CheckBoxList>
            
                <br />
                </td></tr>
          
    
    <tr><td colspan="4" align="center" >
        <asp:Button ID="Button1" CssClass="button" runat="server" 
            Text="Add" onclick="Button1_Click" 
            onclientclick="return check();" /></td></tr></table>
    </div>
    </form>
</body>
</html>
